package com.ssy.mapper;

import com.ssy.entity.Student;
import com.ssy.entity.StudentQueryParam;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

@Mapper
public interface StudentMapper {
    /**
     * 分页查询
     * @param studentQueryParam
     * @return
     */
    List<Student> page(StudentQueryParam studentQueryParam);

    /**
     * 添加学生信息
     * @param student
     */
    void save(Student student);

    /**
     * 删除学生信息
     * @param ids
     */
    void delete(List<Integer> ids);

    /**
     * 根据id查询学生信息
     * @param id
     * @return
     */
    Student getById(Integer id);

    /**
     * 修改学生信息
     * @param student
     */
    void update(Student student);

    /**
     * 统计学习学历信息
     * @return
     */
    @MapKey("degree")
    List<Map<String, Object>> countStudentDegreeData();

    /**
     * 统计班级信息
     * @return
     */
    @MapKey("")
    List<Map<String, Object>> countStudentByClazz();
}
